package day21;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int t = in.nextInt();
            for (int i = 0; i < t; i++) {
                int n = in.nextInt();
                int k = in.nextInt();
                int[] arr = new int[2 * n];
                for (int j = 0; j < 2 * n; j++) {
                    arr[j] = in.nextInt();
                }
                int[] arr2 = new int[2 * n];
                for (int p = 0; p < k; p++) {
                    int right = 2 * n - 1;
                    int mid = 2 * n / 2 - 1;
                    int q = 0;
                    while (mid >= 0) {
                        arr2[q++] = arr[right--];
                        arr2[q++] = arr[mid--];
                    }
                    for (int j = 0; j < 2 * n; j++) {
                        arr[j] = arr2[j];
                    }
                }
                if ( k % 2 == 1) {
                    for (int j = 2 * n - 1; j >= 0; j--) {
                        if (j == 0) {
                            System.out.println(arr[j]);
                        } else {
                            System.out.print(arr[j] + " ");
                        }
                    }
                } else {
                    for (int j = 0; j < 2 * n; j++) {
                        if (j == 2*n -1 ) {
                            System.out.println(arr[j]);
                        } else {
                            System.out.print(arr[j] + " ");
                        }
                    }
                }

            }
        }
    }
}